package com.zr.sms.serviceimpl;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.zr.sms.dao.EmployeeDao;
import com.zr.sms.daoimpl.EmployeeDaoImpl;
import com.zr.sms.model.Employee;
import com.zr.sms.service.FindUpEmpService;

public class FindUpEmpServiceImpl implements FindUpEmpService{
	EmployeeDao emp = new EmployeeDaoImpl();

	
	public JSONObject findUpemps(int start, int pageSize) {
		JSONObject emps = new JSONObject();
		emps.put("total", emp.getEmpsConut());
		emps.put("rows", JSONArray.fromObject(emp.getUpEmps(start, pageSize)));
		return emps;
	}

	
	public JSONObject findUpemps(int start, int pageSize, String searchname) {
		JSONObject emps = new JSONObject();
		emps.put("total", emp.getEmpsConut(searchname));
		emps.put("rows", JSONArray.fromObject(emp.getUpEmps(start, pageSize, searchname)));
		return emps;
	}


	public int updateEmpPro(Employee emp) {
		// TODO Auto-generated method stub
		return this.emp.updateEmpPro(emp);
	}
}
